package com.yss.common.core.utils.easyexecl;

import com.alibaba.excel.write.handler.SheetWriteHandler;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;
import java.util.Map;

public class CustomSheetWriteHandler implements SheetWriteHandler {
    /**
     * 列宽集合
     */
    private Map<Integer, List<String>> dropDownBoxMaps;
    private Integer startLine;
    private Integer terminateLine;

    /**
     * 构造
     */
    public CustomSheetWriteHandler(Map<Integer, List<String>> dropDownBoxMaps, Integer startLine, Integer terminateLine) {
        this.dropDownBoxMaps = dropDownBoxMaps;
    }

    private static final Logger LOGGER = LoggerFactory.getLogger(CustomSheetWriteHandler.class);

    @Override
    public void beforeSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) {

    }

    @Override
    public void afterSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) {
        LOGGER.info("第{}个Sheet写入成功。", writeSheetHolder.getSheetNo());
        LOGGER.info("普通策略设置setColumnWidth开始~");
        LOGGER.info("普通策略设置setColumnWidth结束~");
    }
}
